package cn.refactor.typersample.slice;

import cn.refactor.typersample.ResourceTable;
import cn.refactor.typersample.SampleFraction;
import cn.refactor.typersample.SamplePresenter;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.ability.fraction.FractionAbility;
import ohos.aafwk.content.Intent;
import ohos.agp.components.StackLayout;

public class MainAbilitySlice extends AbilitySlice {
    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        super.setUIContent(ResourceTable.Layout_ability_main);

        SampleFraction sampleFraction = SampleFraction.newInstance();
        ((FractionAbility) getAbility()).getFractionManager()
                .startFractionScheduler()
                .add(ResourceTable.Id_fragment_container, sampleFraction)
                .submit();
        new SamplePresenter(sampleFraction);
    }

    @Override
    public void onActive() {
        super.onActive();
    }

    @Override
    public void onForeground(Intent intent) {
        super.onForeground(intent);
    }
}
